package com.hxzy.projectssmplus.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hxzy.projectssmplus.dto.SysConfigDTO;
import com.hxzy.projectssmplus.entity.SysConfig;
import com.hxzy.projectssmplus.mapper.SysConfigMapper;
import com.hxzy.projectssmplus.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService {

    @Autowired
    private SysConfigMapper sysConfigMapper;

    @Override
    public IPage<SysConfig> searchByXML(IPage ipage, SysConfigDTO sysConfigDTO) {

        List<SysConfig> sysConfigList = sysConfigMapper.searchByXML(ipage, sysConfigDTO);

        ipage.setRecords(sysConfigList);

        return ipage;
    }

    @Override
    public void deleteConfigByIds(Integer[] configIds) {
        for (Integer configId : configIds) {
            sysConfigMapper.deleteConfigById(configId);
        }
    }


}
